﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace HigLabo.WindowsAzure.RestService.ServiceManagement
{
    public class SwapDeploymentBody
    {
        public String ProductionDeploymentName { get; private set; }
        public String SourceDeployment { get; private set; }

        public SwapDeploymentBody
            (String productionDeploymentName, String sourceDeployment)
        {
            this.ProductionDeploymentName = productionDeploymentName;
            this.SourceDeployment = sourceDeployment;
        }
        public String CreateText()
        {
            var ns = XNamespace.Get("http://schemas.microsoft.com/windowsazure");
            var doc = new XDocument();
            var root = new XElement(ns.GetName("Swap"));
            doc.Add(root);
            root.Add(new XElement(ns.GetName("Production"), this.ProductionDeploymentName));
            root.Add(new XElement(ns.GetName("SourceDeployment"), this.SourceDeployment));
            return doc.ToString();
        }


    }
}
